{template common/header}

<div id="side">
发微博
</div>
<div id="content">
{if !$action}
	<div class="inputbox">
		<form action="" method="post">
			<textarea id="contentbox" class="textarea full" name="text_content"></textarea>
			<div class="sendbox">
				<div id="uploadbox" class="left">
					<div class="photo"><a href="javascript:void(0);">照片</a>
					<div class="sharephoto none">
						<div id="loadform">
							<div id="closephoto"></div>
							请选择要上传的图片：
							<form target="imageUpload" method="post" enctype="multipart/form-data" action="http://127.0.0.1/weibo/index.php?s=/Space/uploadpic" id="upform">
								<input type="file" id="uploadbtn" class="uploadbtn" name="image" title="支持jpg、jpeg、gif、png格式，文件小于2M">
							</form>
						</div>
						<div id="priviewbtn"></div>
						<div id="uploading"><img src="http://127.0.0.1/weibo/Public/images/spinner.gif"> 上传中 <a href="javascript:void(0)" onclick="cencelUpload();">[取消]</a></div>
						<div class="clearline"></div>
						<div id="priviewpoic"></div>
					</div>
					</div>
					<span id="morecontent" style="display:none;"></span>
				</div>
				<div class="right">
					<div class="sendtip inline">
						<span class="sendsp">还能输入<span id="nums">140</span>字</span>
					</div>
					<input name="wsubmit" type="submit" class="sendbutton" value="好了！">
				</div>
				<div class="clear"></div>
			</div>
		</form>
	</div>
	<ul class="wblist c">
		{loop $ls $key $value}
		<li class="left wbavatar">
			{eval echo avatarshow($value['uid'], 'small', 1)}
		</li>
		<li class="wbcontent" id="{$value[cid]}">
			<a href="{URL}/{$value[uid]}">{$value[username]}</a>
			<span class="pl">&nbsp;{eval echo dgmdate($value['dateline'], 'u')}&nbsp;说：</span>
			<div class="wbr">
				<span class="wbtext">{$value[content_body]}</span>
			</div>
			<div class="wbbt">
				<span>来自 <i>{$value[type]}</i></span>
				<span>
					<a href="{URL}/?action=reply&cid={$value[cid]}" class="wbreply"  >{$value[replytimes]}回应</a>
				</span>
			</div>
		</li>
		{/loop}
	</ul>
	{$page}
{elseif $action == 'reply'}
	<ul class="wblist">
		<li class="left wbavatar">
			{eval echo avatarshow($ls['first']['uid'], 'small', 1)}
		</li>
		<li class="wbcontent" id="{$ls[first][cid]}">
			<a href="{URL}/{$ls[first][uid]}">{$ls[first][username]}</a>
			<span class="pl">&nbsp;{eval echo dgmdate($ls['first']['dateline'], 'u')}&nbsp;说：</span>
			<div class="wbr">
				<span class="wbtext">{$ls[first][content_body]}</span>
			</div>
			<div class="wbbt">
				<span>来自 <i>{$ls[first][type]}</i></span>
				<span>
					<a href="{URL}/?action=reply&cid={$ls[first][cid]}" class="wbreply"  >{$ls[first][replytimes]}回应</a>
				</span>
			</div>
		</li>
	</ul>
	<div class="mailarea">
	<!--{loop $ls['reply'] $key $value}-->
		<div class="maillist">
			<div {if $value['uid'] == $ls['first']['uid']}class = "right"{else}class = "left"{/if}>
				{eval echo avatarshow($value[uid], 'small', 1, $value[username])}
			</div>
			<div {if $value['uid'] == $ls['first']['uid']}class = "mail left"{else}class = "mail right"{/if}>
				<div class = "mailto left">
					<span {if $value['uid'] == $ls['first']['uid']}class = "right"{else}class = "left"{/if}>
					{$value[username]}
					</span>
					<span {if $value['uid'] == $ls['first']['uid']}class = "mailtime left"{else}class = "mailtime right"{/if}>
					{eval echo dgmdate($value[dateline], 'u')}
					</span>
				</div>
				<div class="clear"></div>
				<div class = "mailtext">
					{eval echo nl2br(html_entity_decode($value[content_body]))}
				</div>
			</div>
			<div class="clear"></div>
		</div>
	<!--{/loop}-->
	</div>
	<div class="clear"></div>
	{$page}
	<div class="replymail">
		<div class="left">{eval echo avatarshow(NULL, 'small', 1)}</div>
		<div class="mail right">
			<form action="" method="post">
				<input type="hidden" name="formhash" value="{FORMHASH}" />
				<input type="hidden" name="replyid" value="{$ls[first][cid]}" />
				<textarea name="replytext" class="textarea full"></textarea>
				<input name="rsubmit" type="submit" value="回复" />
			</form>
		</div>
	</div>
{/if}
</div>
{template common/footer}